package com.javautil;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class SimpleDateFormatDemo {
    public static void main(String[] args) throws ParseException {
        Date date = new Date(1646755200000L);
        SimpleDateFormat sdf1 = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
        System.out.println(sdf1.format(date));

        String a = "22-03-09 00:00:00";
        Date day = sdf1.parse(a);
        System.out.println(day.getTime());
    }
}
